<template>
  <div class="inputContantiner">
    <div class="organizationDetails">
      <p class="subTitle"><span class="line"></span> <span style="color: #3f8ffc">家庭成员信息</span></p>
      <el-table @selection-change="handleSelectionChange" size="small" :data="data11" border style="width: 100%">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column v-for="(it, in1) in thList" :key="in1" :prop="it.sortField" :label="it.title" align="center">
          <template slot-scope="scope">
            <p v-if="it.title == '与户主关系'" class="scopeItem">
              {{
                scope.row.HOUSERELATIONSHIP == '156'
                  ? '户主'
                  : scope.row.HOUSERELATIONSHIP == '267'
                  ? '孙女'
                  : scope.row.HOUSERELATIONSHIP == '28'
                  ? '夫妻'
                  : scope.row.HOUSERELATIONSHIP == '30'
                  ? '长子'
                  : scope.row.HOUSERELATIONSHIP == '166'
                  ? '次子'
                  : scope.row.HOUSERELATIONSHIP == '167'
                  ? '孙子'
                  : scope.row.HOUSERELATIONSHIP == '168'
                  ? '次女'
                  : scope.row.HOUSERELATIONSHIP == '169'
                  ? '长女'
                  : scope.row.HOUSERELATIONSHIP == '701'
                  ? '父亲'
                  : scope.row.HOUSERELATIONSHIP == '702'
                  ? '母亲'
                  : scope.row.HOUSERELATIONSHIP == '720'
                  ? '奶奶'
                  : scope.row.HOUSERELATIONSHIP == '721'
                  ? '爷爷'
                  : '其他亲属'
              }}
            </p>
            <p v-if="it.title == '是否村集体股东'" class="scopeItem">
              {{ scope.row.IF_CJTGD ? (scope.row.IF_CJTGD == '5' ? '是' : '否') : '' }}
            </p>
            <p v-else-if="it.title == '是否机关事业单位'" class="scopeItem">
              {{ scope.row.IF_JGSYDW ? (scope.row.IF_JGSYDW == '5' ? '是' : '否') : '' }}
            </p>
            <!-- <p v-else-if="it.title == '婚姻状况'" class="scopeItem">
              {{ scope.row.HYZK ? (scope.row.HYZK == '7' ? '已婚' : scope.row.HYZK == '8' ? '未婚' : '离婚') : '' }}
            </p> -->
            <p v-else-if="it.title == '是否有不动产'" class="scopeItem">
              {{ scope.row.IF_BDC ? (scope.row.IF_BDC == '5' ? '是' : '否') : '' }}
            </p>
            <p v-else-if="it.title == '性别'" class="scopeItem">{{ scope.row.FAMILYSEX == '3' ? '男' : '女' }}</p>
            <p v-else-if="it.title != '与户主关系'">{{ scope.row[it.sortField] }}</p>
          </template>
        </el-table-column>
      </el-table>
      <van-button v-show="Isshowbutton" type="info" size="small" style="position: absolute; top: 6px; left: 344px" @click="handleAddusers('添加')">添加</van-button>
      <van-button v-show="Isshowbutton" type="info" size="small" style="position: absolute; top: 6px; left: 299px" @click="handleAddusers('修改')">修改</van-button>
      <van-button v-show="Isshowbutton" type="info" size="small" style="position: absolute; top: 6px; left: 254px" @click="handleAddusers('删除')">删除</van-button>
      <van-dialog v-model="isShow" :title="dialogTitle" show-cancel-button @confirm="saveBtn" @cancel="cancelBtn">
        <van-form validate-first>
          <div style="padding: 10px">
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <van-field v-model="tableFrom[0].FAMILYNAME" :required="true" label="姓名" placeholder="请输入姓名" />
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <van-field v-model="tableFrom[0].FAMILYAGE" :required="true" label="年龄" placeholder="请输入年龄" />
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <!-- <van-field name="validator" v-model="tableFrom.YHZGX" label="与户主关系" placeholder /> -->
              <van-field
                readonly
                clickable
                name="picker"
                @click="ENUM.HOUSERELATIONSHIP = true"
                :value="tableFrom[0].HOUSERELATIONSHIP | inUseName(ENUM.YHZGXARR)"
                :required="true"
                label="与户主关系"
                placeholder="请选择与户主关系" />
              <van-popup v-model="ENUM.HOUSERELATIONSHIP" position="bottom" get-container="#popup">
                <van-picker show-toolbar :columns="ENUM.YHZGXARR" value-key="DICNAME" @confirm="onConfirm14" @cancel="ENUM.HOUSERELATIONSHIP = false" />
              </van-popup>
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <!-- <van-field name="validator" v-model="tableFrom.YHZGX" label="与户主关系" placeholder /> -->
              <van-field readonly clickable name="picker" @click="ENUM.XB1 = true" :value="tableFrom[0].FAMILYSEX | inUseName(ENUM.XBARR)" :required="true" label="性别" placeholder="请选择性别" />
              <van-popup v-model="ENUM.XB1" position="bottom" get-container="#popup">
                <van-picker show-toolbar :columns="ENUM.XBARR" value-key="DICNAME" @confirm="onConfirm5" @cancel="ENUM.XB1 = false" />
              </van-popup>
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <!-- <van-field name="validator" v-model="tableFrom.YHZGX" label="与户主关系" placeholder /> -->
              <van-field readonly clickable name="picker" @click="ENUM.CJT = true" :value="tableFrom[0].IF_CJTGD | inUseName(ENUM.CJTARR)" label="是否村集体股东" placeholder="选择是否村集体股东" />
              <van-popup v-model="ENUM.CJT" position="bottom" get-container="#popup">
                <van-picker show-toolbar :columns="ENUM.CJTARR" value-key="DICNAME" @confirm="onConfirm15" @cancel="ENUM.CJT = false" />
              </van-popup>
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <!-- <van-field name="validator" v-model="tableFrom.YHZGX" label="与户主关系" placeholder /> -->
              <van-field readonly clickable name="picker" @click="ENUM.IFBDC = true" :value="tableFrom[0].IF_BDC | inUseName(ENUM.IFBDCARR)" label="是否有不动产" placeholder="请选择是否有不动产" />
              <van-popup v-model="ENUM.IFBDC" position="bottom" get-container="#popup">
                <van-picker show-toolbar :columns="ENUM.IFBDCARR" value-key="DICNAME" @confirm="onConfirm16" @cancel="ENUM.IFBDC = false" />
              </van-popup>
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <!-- <van-field name="validator" v-model="tableFrom.YHZGX" label="与户主关系" placeholder /> -->
              <van-field
                readonly
                clickable
                name="picker"
                @click="ENUM.IFJGSYDW = true"
                :value="tableFrom[0].IF_JGSYDW | inUseName(ENUM.IFJGSYDWARR)"
                label="是否机关事业单位"
                placeholder="请选择是否机关事业单位" />
              <van-popup v-model="ENUM.IFJGSYDW" position="bottom" get-container="#popup">
                <van-picker show-toolbar :columns="ENUM.IFJGSYDWARR" value-key="DICNAME" @confirm="onConfirm17" @cancel="ENUM.IFJGSYDW = false" />
              </van-popup>
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <!-- <van-field name="validator" v-model="tableFrom.YHZGX" label="与户主关系" placeholder /> -->
              <!-- <van-field
                readonly
                clickable
                name="picker"
                :value="tableFrom[0].HYZK | inUseName(ENUM.HYZKARR)"
                :required="true"
                @click="ENUM.HYZK = true"
                label="婚姻状况"
                placeholder="请选择婚姻状况" />
              <van-popup v-model="ENUM.HYZK" position="bottom" get-container="#popup">
                <van-picker show-toolbar :columns="ENUM.HYZKARR" value-key="DICNAME" @confirm="onConfirm18" @cancel="ENUM.HYZK = false" />
              </van-popup> -->
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <van-field :rules="[{ message: '请输入正确身份证号码' }]"  v-model="tableFrom[0].FAMILYIDCARD" label="身份证号" placeholder="请输入身份证号" />
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <van-field v-model="tableFrom[0].HZSZD" label="户口所在地" placeholder="请输入户口所在地" />
            </div>
            <div style="display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #d2d2d2; color: black">
              <!-- <span style="color: #ff0000">*</span> -->
              <van-field v-model="tableFrom[0].BDCBH" label="不动产编号" placeholder="请输入不动产编号" />
            </div>
            
          </div>
        </van-form>
      </van-dialog>
    </div>
  </div>
</template>

<script>
import { FileServerProxy } from '@/utils/api'
import { v4 as uuidv4 } from 'uuid'
import { GSA_Search } from '../../../common/commonApi'
export default {
  filters: {
    inUseName: function (msg, data) {
      let name = ''
      data.forEach((item) => {
        if (item.DICID == msg) {
          name = item.DICNAME
        }
      })
      return name
    }
  },
  props: {
    thList: Array,
    Isshowbutton: Boolean,
    mainrowGuid: String,
    IsFarmData: Boolean,
    //需要查询的视图 上一个环节的
    ROW_GUID: String,
    //需要保存数据的视图 当前环节
    SaveDataGuid: String,
    //类型 1: 村级审2:现场踏 3:方联审
    OPTYPE: String
  },
  data() {
    return {
      multipleSelection10: [],
      data11: [],
      isShow: false,
      IsAddData: '',
      dialogTitle: '',
      HOUSERELATIONSHIP: '',
      showPickerq1: false,
      showPickerq: false,
      currentDate: new Date(),
      minDate: new Date(1970, 0, 1),
      maxDate: new Date(2089, 12, 1),
      ENUM: {
        XB: false,
        SPLX: false,
        SPLXArr: [],
        TKBMARR11: [
          {
            DICID: '5',
            DICNAME: '是'
          },
          {
            DICID: '6',
            DICNAME: '否'
          }
        ],
        XB1: false,
        IFBDC: false,
        HYZK: false,
        DHLY: false,
        DHLYARR: [],
        HYZKARR: [],
        IFBDCARR: [],
        IF_WFH_WG: false,
        IF_WFH_WGArr: [],
        IFJGSYDW: false,
        IFJGSYDWARR: [],
        IF_JXBLArr: [],
        IF_JXBL: false,
        CJT: false,
        XBARR: [],
        CJTARR: [],
        SF: false,
        SF1: false,
        SF2: false,
        //处置情况
        SFARR: [],
        //建房类型
        NYD: false,
        NYDARR: [],
        //地类
        JFLX: false,
        JFLXARR: [],
        //建筑层数
        YDLX: false,
        YDLXARR: [],
        //污水处理
        JGLX: false,
        JGLXARR: [],
        //建筑结构
        WSCLFS: false,
        WSCLFSARR: [],
        //邻居同意否
        TKBM: false,
        TKBMARR: [],
        CHBM: false,
        CHBMARR: [],
        SFSJSLYJ: false,
        SFSJSLYJARR: [],
        //与户主关系
        HOUSERELATIONSHIP: false,
        TKBMIF_GZS: false,
        YHZGXARR: [],
        NYDARR: []
      },
      zgData: [
        {
          title: '家庭成员信息',
          tableData: [],
          tablecoums: [
            {
              name: '姓名',
              prop: 'FAMILYNAME',
              isread: true
            },
            {
              name: '年龄',
              prop: 'FAMILYAGE',
              isread: true
            },
            {
              name: '与户主关系',
              prop: 'HOUSERELATIONSHIP',
              isread: true
            },
            {
              name: '身份证号',
              prop: 'FAMILYIDCARD',
              isread: true
            },
            {
              name: '户口所在地',
              prop: 'HZSZD',
              isread: true
            },
            {
              name: '性别',
              prop: 'FAMILYSEX',
              isread: true
            },
            {
              name: '是否村集体股东',
              prop: 'IF_CJTGD'
            },
            // {
            //   name: '婚姻状况',
            //   prop: 'HYZK',
            //   isread: true
            // },
            {
              name: '是否有不动产',
              prop: 'IF_BDC'
            },
            {
              name: '是否机关事业单位',
              prop: 'IF_JGSYDW'
            },
            {
              name: '不动产编号',
              prop: 'BDCBH'
            },
          ]
        }
      ],
      tableFrom: [
        {
          FAMILYNAME: '',
          HOUSERELATIONSHIP: '',
          FAMILYSEX: '',
          FAMILYAGE: '',
          HZSZD: '',
          IF_CJTGD: '',
          HYZK: '',
          IF_BDC: '',
          BDCBH: '',
          IFJGSYDW: '',
          IF_JGSYDW: '',
          CREMATIONTIME: '',
          DEATHTIME: ''
        }
      ],
      dataguids:[
        {
          key:'1',
          value:'414a1c12-1f2c-4b15-8440-6b03a4c2ff48'
        },
        {
          key:'2',
          value:'35bdee32-62cc-4249-8990-3d4fdbbd904f'
        },
        {
          key:'3',
          value:'471f9e70-b4ba-4bc3-9158-43a36800bf19'
        },
        {
          key:'4',
          value:'9403bdd5-de35-47b2-bfa0-961bf86b6a53'
        }
      ]
    }
  },
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection10 = val
    },
    //删除家庭成员
    deleteFarmlyData: async function () {
      
      console.log(this.tableFrom[0])
      var p = {
        PKID: this.tableFrom[0].PKID,
        ROW_GUID: this.tableFrom[0].ROW_GUID
      }
      let params = {
        accessCode: '434b72c2945518775ee423268b0b8121',
        cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
        params: {
          dataguid: this.SaveDataGuid,
          strParams: JSON.stringify([p]),
          token: window.localStorage.getItem('token') ? window.localStorage.getItem('token') : ''
        }
      }
      const res = await FileServerProxy(params)
      if (res.data && res.data.data) {
        this.$toast.success('删除成功!')
        this.getFarmInfoList(this.SaveDataGuid)
      }
    },
    getFarmInfoList: async function () {
      //先请求现在环节的视图 如果有值就不请求前一个环节的视图
      this.data11 = []
      let params = {
        accessCode: '688bd3883572440a859dfd8ba9194e7b',
        cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
        params: {
          dataguid: this.SaveDataGuid,
          searchObject: JSON.stringify([{ field: 'TO_ROW_GUID', value: this.mainrowGuid, operator: '=' }])
        }
      }
      const res = await FileServerProxy(params)
      try {
        if (res.data.data && JSON.parse(res.data.data) && JSON.parse(res.data.data).Data.length > 0) {
          this.data11 = JSON.parse(res.data.data).Data
        } else{
          params.params.dataguid = this.ROW_GUID
          const res = await FileServerProxy(params)
          if (res.data.data && JSON.parse(res.data.data) && JSON.parse(res.data.data).Data.length > 0) {
            this.data11 = JSON.parse(res.data.data).Data
          }
        }
      } catch (err) {
        console.log(err)
      }
      if (this.data11.length > 0) {
        this.IsAddData = 'edit'
      } else {
        this.IsAddData = 'added'
      }
    },
    handleAddusers(name) {
      if (name == '添加') {
        this.isShow = true
        this.dialogTitle = '新增'
        this.HOUSERELATIONSHIP = ''
        this.IF_CJTGD = ''
        this.IF_BDC = ''
        this.IF_JGSYDW = ''
        this.currentDate = ''
        this.HYZK = ''
        this.FormXB = ''
        this.tableFrom = [
          {
            FAMILYNAME: '',
            HOUSERELATIONSHIP: '',
            FAMILYSEX: '',
            FAMILYAGE: '',
            HZSZD: '',
            IF_CJTGD: '',
            HYZK: '',
            IF_BDC: '',
            BDCBH: '',
            IFJGSYDW: '',
            IF_JGSYDW: '',
            CREMATIONTIME: '',
            DEATHTIME: ''
          }
        ]
      } else if (name == '删除') {
        this.$confirm({
          title: '提示',
          message: '确认删吗？',
          btn: {
            okText: '确定',
            cancelText: '取消'
          }
        })
          .then(() => {
            // do something
            if (this.multipleSelection10.length == 0) {
              this.$toast.fail('请选择一行数据')
            } else if (this.multipleSelection10.length > 1) {
              this.$toast.fail('只能选择选择一行数据')
            } else {
              this.tableFrom = this.multipleSelection10
              this.deleteFarmlyData()
            }
          })
          .catch(() => {
            console.log('no')
          })
      } else {
        console.log(this.multipleSelection10, 'this.multipleSelection10')
        if (this.multipleSelection10.length == 0) {
          this.$toast.fail('请选择一行数据')
        } else if (this.multipleSelection10.length > 1) {
          this.$toast.fail('只能选择选择一行数据')
        } else {
          this.isShow = true
          this.dialogTitle = '修改'
          this.tableFrom = this.multipleSelection10
          this.HOUSERELATIONSHIP = this.multipleSelection10[0].HOUSERELATIONSHIP
          this.FormXB = this.multipleSelection10[0].FAMILYSEX
          this.IF_BDC = this.multipleSelection10[0].IF_BDC
          this.IF_JGSYDW = this.multipleSelection10[0].IF_JGSYDW
          this.currentDate = this.multipleSelection10[0].currentDate
          this.HYZK = this.multipleSelection10[0].HYZK
        }
      }
    },
    cancelBtn() {
      this.isShow = false
    },
    // 格式化日期
    dateFormat(val) {
      let year = val.getFullYear()
      let month = val.getMonth() + 1
      let day = val.getDate()
      let hour = val.getHours()
      let minute = val.getMinutes()
      if (month >= 1 && month <= 9) {
        month = `0${month}`
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`
      }
      if (hour >= 0 && hour <= 9) {
        hour = `0${hour}`
      }
      if (minute >= 0 && minute <= 9) {
        minute = `0${minute}`
      }
      let time = `${year}-${month}-${day}`
      return time
    },
    //获取枚举数据
    getEnum(emitData = []) {
      emitData.forEach(async (item) => {
        let params = {
          accessCode: '688bd3883572440a859dfd8ba9194e7b',
          cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000',
          params: {
            dataguid: item,
            searchObject: JSON.stringify([]),
            token: window.localStorage.getItem('token')
          }
        }
        const res = await FileServerProxy(params)
        let newData = JSON.parse(res.data.data).Data
        switch (item) {
          case 'a8e5782d-9a59-48e4-b35b-654b9bb667ca':
            this.ENUM.XBARR = newData

            break
          case '8670f99d-6127-45ec-be7c-8d76303bf38c':
            // this.ENUM.WSCLFSARR = newData
            this.ENUM.YHZGXARR = newData
            break
          case '173cb6af-d07c-4143-8169-8436af10264d':
            this.ENUM.HYZKARR = newData
            break
          case '67176c5f-ebad-4f7b-9cb4-d2a926f511cf':
            this.ENUM.DHLYARR = newData
            break
          case 'c3c0ecf0-2d89-4394-9f51-0fbb5de4a322':
            this.ENUM.IF_WFH_WGArr = newData
            break
          case 'd6aebfde-a9d7-441b-9f10-eb4c6651ea8b':
            this.ENUM.SPLXArr = newData
            break
          case '86d6eb80-8bcb-49f6-b5c3-462ac1ae585d':
            this.ENUM.IF_JXBLArr = newData
            this.ENUM.TKBMARR = newData
            this.ENUM.SFSJSLYJARR = newData
            this.ENUM.CJTARR = newData
            this.ENUM.IFBDCARR = newData
            this.ENUM.IFJGSYDWARR = newData
            break
        }
      })
    },
    onConfirm18(value) {
      this.tableFrom[0].HYZK = value.DICID
      this.HYZK = value.DICNAME
      this.ENUM.HYZK = false
    },
    onConfirm14(value) {
      this.tableFrom[0].HOUSERELATIONSHIP = value.DICID
      this.HOUSERELATIONSHIP = value.DICNAME
      this.ENUM.HOUSERELATIONSHIP = false
    },
    onConfirm19(val) {
      this.showPickerq = false
      this.tableFrom[0].DEATHTIME = this.dateFormat(val)
    },
    onConfirm5(value) {
      //   this.JFData.SEX = value.DICID
      this.tableFrom[0].FAMILYSEX = value.DICID
      this.sexName = value.DICNAME
      this.FormXB = value.DICNAME
      this.ENUM.XB = false
      this.ENUM.XB1 = false
    },
    onConfirm20(val) {
      this.showPickerq1 = false
      this.tableFrom[0].CREMATIONTIME = this.dateFormat(val)
    },
    onConfirm21(value) {
      this.ENUM.DHLY = false
      this.DHLY1.DHLY = value.DICID
      this.DHLY = value.DICNAME
    },
    onConfirm17(value) {
      this.tableFrom[0].IF_JGSYDW = value.DICID
      this.IFJGSYDW = value.DICNAME
      this.ENUM.IFJGSYDW = false
    },
    onConfirm16(value) {
      this.tableFrom[0].IF_BDC = value.DICID
      this.IFBDC = value.DICNAME
      this.ENUM.IFBDC = false
    },
    onConfirm15(value) {
      this.tableFrom[0].IF_CJTGD = value.DICID
      this.IFCJTGD = value.DICNAME
      this.ENUM.CJT = false
    },
    saveBtn() {
      let me = this
      let nowLine = 0
      let bitianxiang = {
        FAMILYNAME: '',
        FAMILYSEX: '',
        FAMILYAGE: '',
        HOUSERELATIONSHIP: ''
      }
      //   if (me.IsAddData == 'added') {
      Object.keys(me.tableFrom[0]).forEach((it) => {
        Object.keys(bitianxiang).forEach((item) => {
          if (it == item) {
            if (me.tableFrom[0][it]) {
            } else {
              console.log(it)
              nowLine += 1
            }
          }
        })
      })
      if (nowLine == 0) {
        me.zgData.forEach((item) => {
          if (item.title == '家庭成员信息') {
            if (me.dialogTitle == '新增') {
              //组织家庭成员信息
              //item.tableData.push(newObj)
              let uuid1 = uuidv4()
              me.tableFrom[0].TO_ROW_GUID = JSON.parse(this.$route.query.data).TO_ROW_GUID
              me.tableFrom[0].ROW_GUID = uuid1
              // me.tableFrom[0].PKID = JSON.parse(this.$route.query.data).PKID + 1
              me.tableFrom[0].OPTYPE = this.OPTYPE
              // me.tableFrom[0].eca_RowState = me.IsAddData
              let newObj = JSON.parse(JSON.stringify(me.tableFrom[0]))
              this.data11.push(newObj)
              let params = {
                accessCode: '0fb3f6123d1b4fe6851c99532c463f6f',
                cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
                params: {
                  dataguid: this.SaveDataGuid,
                  strParams: JSON.stringify([newObj])
                }
              }
              
              FileServerProxy(params).then((res) => {
                
              })
            } else {
              this.data11.forEach((itess) => {
                if (itess.PKID == me.tableFrom[0].PKID) {
                  this.data11[0].eca_RowState = me.IsAddData
                  let params = {
                    accessCode: '77ad6c1591e54d4fbc45ecc90374a2a2',
                    cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
                    params: {
                      dataguid: this.SaveDataGuid,
                      strParams: JSON.stringify([itess])
                    }
                  }
                  FileServerProxy(params).then((res) => {
                    if (JSON.parse(res.data.data).Success) {
                      me.$toast.success('修改成功!')
                      this.getFarmInfoList(this.SaveDataGuid)
                    } else {
                      me.$toast.fail('修改失败!')
                    }
                  })
                }
              })
            }
            console.log(item.tableData)
          }
        })
        me.cancelBtn()
      } else {
        this.$toast.fail('请填写必填项!')
        this.isShow = true
      }
      //   }
    },
    getLianJianRenData() {},
    changeData11(index) {
      let newList = this.data11.concat(this.zgData[0].tableData)
      console.log(newList)
      this.$emit('update:data11', newList)
    }
  },
  mounted() {
    this.getFarmInfoList()
  },
  created() {
    let emitData = [
      'a8e5782d-9a59-48e4-b35b-654b9bb667ca',
      '2c478392-9c1b-40da-b941-41e4b8c9d6d3',
      'db35edee-88e0-4fae-b14a-868ed4beb1d9',
      'd2ec96d4-b5bc-404a-a9f1-34db915c694b',
      'a892e0f4-5fd6-42b4-b6c2-6e1fc5ebb5dc',
      'f7f359ad-369c-4bf4-892c-294dceb5edef',
      'b65d1943-66f4-49b1-b759-cd9f079dc0d3',
      '86d6eb80-8bcb-49f6-b5c3-462ac1ae585d',
      '8670f99d-6127-45ec-be7c-8d76303bf38c',
      '173cb6af-d07c-4143-8169-8436af10264d',
      '67176c5f-ebad-4f7b-9cb4-d2a926f511cf',
      '52215e71-341a-452b-8823-a8d4aae058ab',
      'c3c0ecf0-2d89-4394-9f51-0fbb5de4a322',
      'd6aebfde-a9d7-441b-9f10-eb4c6651ea8b',
      'd47fc1d9-c756-4a46-8259-7e65c82f26ba'
    ]
    //获取字典值 性别
    this.getEnum(emitData)
    if (this.IsFarmData) {
      //先查询是否有家庭成员信息(踏勘)
      //   this.getLianJianRenData()
    }
  }
}
</script>

<style lang="scss">
.organizationDetails {
  position: relative;

  .subTitle {
    width: 100%;
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #9b9b9b;
    padding-left: 14px;
    font-weight: bold;

    .line {
      width: 6px;
      height: 26px;
      background: #3f8ffc;
      display: inline-block;
      margin-right: 10px;
    }
  }

  .el-table th.el-table__cell > .cell {
    color: black;
  }
}
</style>
